<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: Wickr Protocol</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wickr Protocol</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__packet.html">wickr_packet</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An encrypted packet made with the Wickr protocol.  <a href="structwickr__packet.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__parse__result.html">wickr_parse_result</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">result from parsing an inbound packet  <a href="structwickr__parse__result.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__decode__result.html">wickr_decode_result</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">a packet decoding result  <a href="structwickr__decode__result.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gad269883d0b8b26c4fa52da595ef5ddf7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gad269883d0b8b26c4fa52da595ef5ddf7">OLDEST_PACKET_VERSION</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:gad269883d0b8b26c4fa52da595ef5ddf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga89ff9f93c5494db53d3ff27353989862"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga89ff9f93c5494db53d3ff27353989862">CURRENT_PACKET_VERSION</a>&#160;&#160;&#160;4</td></tr>
<tr class="separator:ga89ff9f93c5494db53d3ff27353989862"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac21e7b7fda1612923d83e7e75166209c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gac21e7b7fda1612923d83e7e75166209c">wickr_key_exchange_create_with_packet_key</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *sender, const <a class="el" href="structwickr__node.html">wickr_node_t</a> *receiver, <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *packet_exchange_key, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *packet_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *psk, uint8_t version)</td></tr>
<tr class="separator:gac21e7b7fda1612923d83e7e75166209c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b967bbdd161d8e37d19c4ab9621771b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga2b967bbdd161d8e37d19c4ab9621771b">wickr_key_exchange_create_with_data</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *sender, const <a class="el" href="structwickr__node.html">wickr_node_t</a> *receiver, <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *packet_exchange_key, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data_to_wrap, <a class="el" href="structwickr__cipher.html">wickr_cipher_t</a> exchange_cipher, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *psk, uint8_t version)</td></tr>
<tr class="separator:ga2b967bbdd161d8e37d19c4ab9621771b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac952913ddaf848d2def181cd55b30883"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gac952913ddaf848d2def181cd55b30883">wickr_packet_create</a> (uint8_t version, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *content, <a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *signature)</td></tr>
<tr class="separator:gac952913ddaf848d2def181cd55b30883"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3427a40815c9f65a78516405d1b88072"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga3427a40815c9f65a78516405d1b88072">wickr_packet_create_from_buffer</a> (const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *buffer)</td></tr>
<tr class="separator:ga3427a40815c9f65a78516405d1b88072"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa983fe863635b69d69d6d86d01443ecf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gaa983fe863635b69d69d6d86d01443ecf">wickr_packet_serialize</a> (const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *packet)</td></tr>
<tr class="separator:gaa983fe863635b69d69d6d86d01443ecf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c95ad86819bacf98c11115d748039db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga0c95ad86819bacf98c11115d748039db">wickr_packet_copy</a> (const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *source)</td></tr>
<tr class="separator:ga0c95ad86819bacf98c11115d748039db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab15d7556ad2806aa823ec2d3e3bf5a46"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gab15d7556ad2806aa823ec2d3e3bf5a46">wickr_packet_destroy</a> (<a class="el" href="structwickr__packet.html">wickr_packet_t</a> **packet)</td></tr>
<tr class="separator:gab15d7556ad2806aa823ec2d3e3bf5a46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac2673bcfeae2f8d693e523809bb6bb30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gac2673bcfeae2f8d693e523809bb6bb30">wickr_parse_result_create_failure</a> (wickr_packet_signature_status signature_status, wickr_decode_error error)</td></tr>
<tr class="separator:gac2673bcfeae2f8d693e523809bb6bb30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7bd98225a92620e1aa5940cf59fdbedf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga7bd98225a92620e1aa5940cf59fdbedf">wickr_parse_result_create_success</a> (<a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *key_exchange_set, <a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a> *key_exchange, <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *enc_payload)</td></tr>
<tr class="separator:ga7bd98225a92620e1aa5940cf59fdbedf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1671066ddc19b38ed05d4460d5a96706"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga1671066ddc19b38ed05d4460d5a96706">wickr_parse_result_copy</a> (const <a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *source)</td></tr>
<tr class="separator:ga1671066ddc19b38ed05d4460d5a96706"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga706d39419c8991f417f37f556cee8df9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga706d39419c8991f417f37f556cee8df9">wickr_parse_result_destroy</a> (<a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> **result)</td></tr>
<tr class="separator:ga706d39419c8991f417f37f556cee8df9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2bd6f49ed993d2290aaafa514eba43ed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga2bd6f49ed993d2290aaafa514eba43ed">wickr_decode_result_create_failure</a> (wickr_decode_error decode_error)</td></tr>
<tr class="separator:ga2bd6f49ed993d2290aaafa514eba43ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga633aaf4cb6159be0110401f06dae458c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga633aaf4cb6159be0110401f06dae458c">wickr_decode_result_create_success</a> (<a class="el" href="structwickr__payload.html">wickr_payload_t</a> *decrypted_payload, <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *payload_key)</td></tr>
<tr class="separator:ga633aaf4cb6159be0110401f06dae458c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga36183bf96372661f890aefbe388bd32a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga36183bf96372661f890aefbe388bd32a">wickr_decode_result_copy</a> (const <a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *result)</td></tr>
<tr class="separator:ga36183bf96372661f890aefbe388bd32a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94154ab44a6c2e9b97a115e37416efe1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga94154ab44a6c2e9b97a115e37416efe1">wickr_decode_result_destroy</a> (<a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> **result)</td></tr>
<tr class="separator:ga94154ab44a6c2e9b97a115e37416efe1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf34d8082df52a7ade2fea54eea65d342"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#gaf34d8082df52a7ade2fea54eea65d342">wickr_packet_create_from_components</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *header_key, const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *payload_key, <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *exchange_key, const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *payload, const wickr_node_array_t *recipients, const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *sender_signing_identity, uint8_t version)</td></tr>
<tr class="separator:gaf34d8082df52a7ade2fea54eea65d342"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1654ef299f9189b27e5e58485f1ffcf5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga1654ef299f9189b27e5e58485f1ffcf5">wickr_parse_result_from_packet</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *packet, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *receiver_node_id, wickr_header_keygen_func header_keygen_func, const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *sender_signing_identity)</td></tr>
<tr class="separator:ga1654ef299f9189b27e5e58485f1ffcf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga32d9da2e10d1d653b2ac894d50aaedb0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__protocol.html#ga32d9da2e10d1d653b2ac894d50aaedb0">wickr_decode_result_from_parse_result</a> (const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *packet, const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *engine, const <a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *parse_result, <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *receiver_dev_id, <a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *receiver_decode_key, <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *receiver_signing_identity, const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *sender_signing_identity)</td></tr>
<tr class="separator:ga32d9da2e10d1d653b2ac894d50aaedb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga89ff9f93c5494db53d3ff27353989862"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga89ff9f93c5494db53d3ff27353989862">&#9670;&nbsp;</a></span>CURRENT_PACKET_VERSION</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CURRENT_PACKET_VERSION&#160;&#160;&#160;4</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The most recent version of the protocol is version 4 </p>

</div>
</div>
<a id="gad269883d0b8b26c4fa52da595ef5ddf7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad269883d0b8b26c4fa52da595ef5ddf7">&#9670;&nbsp;</a></span>OLDEST_PACKET_VERSION</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OLDEST_PACKET_VERSION&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The oldest packet version supported is version 2 </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga36183bf96372661f890aefbe388bd32a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga36183bf96372661f890aefbe388bd32a">&#9670;&nbsp;</a></span>wickr_decode_result_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a>* wickr_decode_result_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a decode result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>the decode result to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated decode result holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="ga2bd6f49ed993d2290aaafa514eba43ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2bd6f49ed993d2290aaafa514eba43ed">&#9670;&nbsp;</a></span>wickr_decode_result_create_failure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a>* wickr_decode_result_create_failure </td>
          <td>(</td>
          <td class="paramtype">wickr_decode_error&#160;</td>
          <td class="paramname"><em>decode_error</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a negative decode result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">decode_error</td><td>the error found during decoding </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated decode result with error 'decode_error' and NULL for other properties </dd></dl>

</div>
</div>
<a id="ga633aaf4cb6159be0110401f06dae458c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga633aaf4cb6159be0110401f06dae458c">&#9670;&nbsp;</a></span>wickr_decode_result_create_success()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a>* wickr_decode_result_create_success </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td>
          <td class="paramname"><em>decrypted_payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>payload_key</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a positive decode result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">decrypted_payload</td><td>the decrypted payload found during decoding </td></tr>
    <tr><td class="paramname">payload_key</td><td>the payload key derived during decoding </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated decode result with no error </dd></dl>

</div>
</div>
<a id="ga94154ab44a6c2e9b97a115e37416efe1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94154ab44a6c2e9b97a115e37416efe1">&#9670;&nbsp;</a></span>wickr_decode_result_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_decode_result_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a> **&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a decode result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>a pointer to the decode result to destroy. All properties of '*result' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga32d9da2e10d1d653b2ac894d50aaedb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga32d9da2e10d1d653b2ac894d50aaedb0">&#9670;&nbsp;</a></span>wickr_decode_result_from_parse_result()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__decode__result.html">wickr_decode_result_t</a>* wickr_decode_result_from_parse_result </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td>
          <td class="paramname"><em>parse_result</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>receiver_dev_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>receiver_decode_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>receiver_signing_identity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>sender_signing_identity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Decode a parsed packet payload using a fetched ephemeral decode_key</p>
<p>For more information see Wickr white paper (Receiving a Message 6-9)</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>the packet to decode </td></tr>
    <tr><td class="paramname">engine</td><td>a crypto engine </td></tr>
    <tr><td class="paramname">parse_result</td><td>a previously generated parse result from 'packet' </td></tr>
    <tr><td class="paramname">receiver_dev_id</td><td>the 'msg_proto_id' of '<a class="el" href="structwickr__dev__info.html" title="Device Information used to make a uniquely identifying set of data for each context running the Wickr...">wickr_dev_info</a>' of the recipient </td></tr>
    <tr><td class="paramname">receiver_decode_key</td><td>the key to attempt to complete the key exchange for discovered in the parse phase, so that the payload can be decoded </td></tr>
    <tr><td class="paramname">receiver_signing_identity</td><td>the recipient of the packet </td></tr>
    <tr><td class="paramname">sender_signing_identity</td><td>the sender of the packet used </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a decode result containing decrypted packet information if decode succeeded </dd></dl>

</div>
</div>
<a id="ga2b967bbdd161d8e37d19c4ab9621771b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b967bbdd161d8e37d19c4ab9621771b">&#9670;&nbsp;</a></span>wickr_key_exchange_create_with_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a>* wickr_key_exchange_create_with_data </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>sender</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__node.html">wickr_node_t</a> *&#160;</td>
          <td class="paramname"><em>receiver</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>packet_exchange_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>data_to_wrap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__cipher.html">wickr_cipher_t</a>&#160;</td>
          <td class="paramname"><em>exchange_cipher</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>psk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>version</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Compute a key exchange given sender/receiver information and bytes to protect (Sender Encoding) This method at a high level creates a shared secret between a sender and receiver (ECDH), runs the shared secret through a kdf (HKDF) and then uses the resulting secret as a cipher key to encrypt bytes of data. 'wickr_key_exchange_create_with_packet_key' also exists as a version of this function to specifically wrap cipher_keys instead of raw data</p>
<p>See Wickr white paper 'Prepare Key Exchange Data' for more information</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine supporting ECDH key exchanges </td></tr>
    <tr><td class="paramname">sender</td><td>the identity chain of the sender </td></tr>
    <tr><td class="paramname">receiver</td><td>the node this key exchange is destined for </td></tr>
    <tr><td class="paramname">packet_exchange_key</td><td>an EC key to use for the sender side of the ECDH function, the private component of this key is no longer needed after this function is called. The public component of it will get forwarded in the message key exchange set to the receiver </td></tr>
    <tr><td class="paramname">data_to_wrap</td><td>This is the data we are protecting by the output of the key exchange </td></tr>
    <tr><td class="paramname">exchange_cipher</td><td>the cipher that the exchange should use protect 'data_to_wrap' with </td></tr>
    <tr><td class="paramname">psk</td><td>optional pre-shared key data to put into the 'salt' field of HKDF </td></tr>
    <tr><td class="paramname">version</td><td>the version of the packet being generated </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated key exchange object holding public metadata about this exchange and the computed exchange data </dd></dl>

</div>
</div>
<a id="gac21e7b7fda1612923d83e7e75166209c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac21e7b7fda1612923d83e7e75166209c">&#9670;&nbsp;</a></span>wickr_key_exchange_create_with_packet_key()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a>* wickr_key_exchange_create_with_packet_key </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>sender</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__node.html">wickr_node_t</a> *&#160;</td>
          <td class="paramname"><em>receiver</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>packet_exchange_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>packet_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>psk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>version</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Compute a key exchange given sender/receiver information and a packet key to protect (Sender Encoding) Thie function is a convience function around 'wickr_key_exchange_create_with_data' that determines exchange_cipher automaticallly based on 'packet_key' cipher and also takes care of serializing 'packet_key'</p>
<p>See Wickr white paper 'Prepare Key Exchange Data' for more information</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine supporting ECDH key exchanges </td></tr>
    <tr><td class="paramname">sender</td><td>the identity chain of the sender </td></tr>
    <tr><td class="paramname">receiver</td><td>the node this key exchange is destined for </td></tr>
    <tr><td class="paramname">packet_exchange_key</td><td>an EC key to use for the sender side of the ECDH function, the private component of this key is no longer needed after this function is called. The public component of it will get forwarded in the message key exchange set to the receiver </td></tr>
    <tr><td class="paramname">packet_key</td><td>the cipher key to use for encrypting the payload of the message that is being created. This is the data we are protecting </td></tr>
    <tr><td class="paramname">psk</td><td>optional pre-shared key data to put into the 'salt' field of HKDF </td></tr>
    <tr><td class="paramname">version</td><td>the version of the packet being generated </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated key exchange object holding public metadata about this exchange and the computed exchange data </dd></dl>

</div>
</div>
<a id="ga0c95ad86819bacf98c11115d748039db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0c95ad86819bacf98c11115d748039db">&#9670;&nbsp;</a></span>wickr_packet_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__packet.html">wickr_packet_t</a>* wickr_packet_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a packet</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the packet to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated packet holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="gac952913ddaf848d2def181cd55b30883"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac952913ddaf848d2def181cd55b30883">&#9670;&nbsp;</a></span>wickr_packet_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__packet.html">wickr_packet_t</a>* wickr_packet_create </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>version</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>content</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ecdsa__result.html">wickr_ecdsa_result_t</a> *&#160;</td>
          <td class="paramname"><em>signature</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a packet from components</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">version</td><td>see 'wickr_protocol' property documentation property documentation </td></tr>
    <tr><td class="paramname">content</td><td>see 'wickr_protocol' property documentation property documentation </td></tr>
    <tr><td class="paramname">signature</td><td>see 'wickr_protocol' property documentation property documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated packet owning the properties passed in </dd></dl>

</div>
</div>
<a id="ga3427a40815c9f65a78516405d1b88072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3427a40815c9f65a78516405d1b88072">&#9670;&nbsp;</a></span>wickr_packet_create_from_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__packet.html">wickr_packet_t</a>* wickr_packet_create_from_buffer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>buffer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Parse a packet from a buffer generated by 'wickr_packet_serialize'</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>a buffer output from 'wickr_packet_serialize' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated packet using parsed data from 'buffer' or NULL if parsing fails </dd></dl>

</div>
</div>
<a id="gaf34d8082df52a7ade2fea54eea65d342"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf34d8082df52a7ade2fea54eea65d342">&#9670;&nbsp;</a></span>wickr_packet_create_from_components()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__packet.html">wickr_packet_t</a>* wickr_packet_create_from_components </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>header_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__key.html">wickr_cipher_key_t</a> *&#160;</td>
          <td class="paramname"><em>payload_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__ec__key.html">wickr_ec_key_t</a> *&#160;</td>
          <td class="paramname"><em>exchange_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__payload.html">wickr_payload_t</a> *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const wickr_node_array_t *&#160;</td>
          <td class="paramname"><em>recipients</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>sender_signing_identity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>version</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Generate a packet given components</p>
<p>For more information see Wickr white paper (Sending a Message)</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine capable of ECDH and signing operations using exchange_key, and cipher operations using payload_key </td></tr>
    <tr><td class="paramname">header_key</td><td>the key to encrypt the key exchange set of the message with </td></tr>
    <tr><td class="paramname">payload_key</td><td>the key to encrypt the payload of the message with </td></tr>
    <tr><td class="paramname">exchange_key</td><td>the key to use as the local key exchange keypair, the public side of this key will wind up in the resulting packet key exchange set </td></tr>
    <tr><td class="paramname">payload</td><td>the plaintext payload to encrypt and bundle into the packet </td></tr>
    <tr><td class="paramname">recipients</td><td>the array of nodes that the </td></tr>
    <tr><td class="paramname">sender_signing_identity</td><td>the identity chain belonging to the creator of the packet </td></tr>
    <tr><td class="paramname">version</td><td>the version of the protocol encoding to use for this packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a 'sender_signing_identity' signed packet containing encrypted payload 'payload, and key exchange set for 'recipients' </dd></dl>

</div>
</div>
<a id="gab15d7556ad2806aa823ec2d3e3bf5a46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab15d7556ad2806aa823ec2d3e3bf5a46">&#9670;&nbsp;</a></span>wickr_packet_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_packet_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__packet.html">wickr_packet_t</a> **&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a packet</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>a pointer to the packet to destroy. All properties of '*packet' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaa983fe863635b69d69d6d86d01443ecf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa983fe863635b69d69d6d86d01443ecf">&#9670;&nbsp;</a></span>wickr_packet_serialize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_packet_serialize </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serialize a packet to a buffer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>the packet to serialize </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer representing the packet in the following format: | VERSION (4BITS) SIGNATURE_CURVE_ID (4BITS) | CONTENT | SIGNATURE OF CONTENT | </dd></dl>

</div>
</div>
<a id="ga1671066ddc19b38ed05d4460d5a96706"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1671066ddc19b38ed05d4460d5a96706">&#9670;&nbsp;</a></span>wickr_parse_result_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a>* wickr_parse_result_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> *&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a parse result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>the parse result to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated parse result holding a deep copy of the properties of 'source' </dd></dl>

</div>
</div>
<a id="gac2673bcfeae2f8d693e523809bb6bb30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac2673bcfeae2f8d693e523809bb6bb30">&#9670;&nbsp;</a></span>wickr_parse_result_create_failure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a>* wickr_parse_result_create_failure </td>
          <td>(</td>
          <td class="paramtype">wickr_packet_signature_status&#160;</td>
          <td class="paramname"><em>signature_status</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_decode_error&#160;</td>
          <td class="paramname"><em>error</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a negative parse result due to a failure</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">signature_status</td><td>status of packet signature validation </td></tr>
    <tr><td class="paramname">error</td><td>error message related to parsing the packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a parse result containing the provided status information and NULL properties </dd></dl>

</div>
</div>
<a id="ga7bd98225a92620e1aa5940cf59fdbedf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7bd98225a92620e1aa5940cf59fdbedf">&#9670;&nbsp;</a></span>wickr_parse_result_create_success()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a>* wickr_parse_result_create_success </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__key__exchange__set.html">wickr_key_exchange_set_t</a> *&#160;</td>
          <td class="paramname"><em>key_exchange_set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__key__exchange.html">wickr_key_exchange_t</a> *&#160;</td>
          <td class="paramname"><em>key_exchange</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>enc_payload</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a positive parse result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">key_exchange_set</td><td>the parsed public key exchange set for all recipients </td></tr>
    <tr><td class="paramname">key_exchange</td><td>discovered key exchange for a particular requested node, or NULL if no node was specified </td></tr>
    <tr><td class="paramname">enc_payload</td><td>the encrypted payload parsed from the message </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a parse result containing the provided information and non-error codes for 'signature_status' and 'err' </dd></dl>

</div>
</div>
<a id="ga706d39419c8991f417f37f556cee8df9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga706d39419c8991f417f37f556cee8df9">&#9670;&nbsp;</a></span>wickr_parse_result_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_parse_result_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a> **&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a parse result</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">result</td><td>a pointer to the parse result to destroy. All properties of '*result' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1654ef299f9189b27e5e58485f1ffcf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1654ef299f9189b27e5e58485f1ffcf5">&#9670;&nbsp;</a></span>wickr_parse_result_from_packet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__parse__result.html">wickr_parse_result_t</a>* wickr_parse_result_from_packet </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> *&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__packet.html">wickr_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>receiver_node_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_header_keygen_func&#160;</td>
          <td class="paramname"><em>header_keygen_func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__identity__chain.html">wickr_identity_chain_t</a> *&#160;</td>
          <td class="paramname"><em>sender_signing_identity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Parse a received packet and validate it's signature</p>
<p>For more information see Wickr white paper (Receiving a Message 1-5)</p>
<p>NOTE: This is a low level function that should not be called directly from this API if it can be avoided. Please use the '<a class="el" href="structwickr__ctx.html" title="Wickr encryption context for high level management of sending / receiving packets using the Wickr pro...">wickr_ctx</a>' API instead since it is a higher level and safer set of functions</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>a crypto engine </td></tr>
    <tr><td class="paramname">packet</td><td>the packet to parse </td></tr>
    <tr><td class="paramname">receiver_node_id</td><td>node_id of the recipient. If set, parsing will fail if a node_id labeled key exchange is not found in the key exchange list. If not set, the resulting parse result will contain NULL for the key exchange and simply return all other properties </td></tr>
    <tr><td class="paramname">header_keygen_func</td><td>a function that can generate a header key for this packet </td></tr>
    <tr><td class="paramname">sender_signing_identity</td><td>the sender of the packet </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a parse result containing a successful or unsuccessful error and signature status </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
